<template>
	<view class="">
		<view class="top_left">
			<view style="display: flex;align-items: center;" @click="map">
				<image src="../../static/收藏.png" mode=""></image>
				<text style="margin: 0 5px;">{{site}}</text>
				<image src="../../static/向右箭头.png" mode=""></image>
			</view>
			<view style="font-size: 13px;color: #AAAAAA;margin-top: 3px;">
				距离您15.4km
			</view>
		</view>
		<view class="phone">
			<text style="margin-left: 10px;margin-right: 10px;">联系电话：</text>
			<text>18732990900</text>
		</view>
		<view class="tiem">
			<view style="margin-bottom: 10px;">取茶时间</view>
			<view style="color: #DBA871;">冰淇淋/鲜食等产品无需等待，可立即向店员领取</view>
		</view>
		<view class="cont">
			<view v-for="(item,index) in navList" :key="index" class="item">
				<view class="" style="margin-right: 10px;">
					<image :src="item.img" mode="" style="width: 60px;height: 60px;"></image>
				</view>
				<view class="" style="width: 250px;">
					{{item.name}}
				</view>
				<view class="">
					<view>￥{{item.price}}</view>
					<view style="color: #AAAAAA;margin-top: 20px;">x{{item.num}}</view>
				</view>
			</view>
		</view>
		<view
			style="height: 40px;display: flex;align-items: center;justify-content: space-between;padding: 0 20px;font-size: 14px;">
			<text>喜茶券</text>
			<view style="display: flex;align-items: center;">
				<text style="color: #D7D7D7;">暂无可用</text>
				<image src="../../static/向右箭头.png" mode="" style="width: 14px;height: 14px;margin-left: 5px;"></image>
			</view>
		</view>
		<view
			style="height: 40px;display: flex;align-items: center;justify-content: space-between;padding: 0 20px;font-size: 14px;">
			<text>备注</text>
			<view style="display: flex;align-items: center;">
				<text style="color: #D7D7D7;">不打包</text>
				<image src="../../static/向右箭头.png" mode="" style="width: 14px;height: 14px;margin-left: 5px;"></image>
			</view>
		</view>
		<view class="" style="padding: 0 20px;">
			<view style="float: right;height: 50px;display: flex;align-items: center;">
				<view>
					<text style="font-size: 13px;color: #7F7F7F;">共{{num}}件商品，小计</text>
					<text>￥{{Zprice}}</text>
				</view>
			</view>
		</view>
		<view style="height: 100px;width: 100%;">

		</view>
		<view class="bottom">
			<view class="" style="margin-left:190px ;">
				<text style="font-size: 14px;color: #7F7F7F;">合计</text>
				<text>￥{{Zprice}}</text>
			</view>
			<view @click="order"
				style="width: 100px;background-color: #DBA871;color: white;height: 50px;text-align: center;line-height: 50px;">
				支付</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navList: [],
				site: '美年广场GO店',
				Zprice: '',
			}
		},
		mounted() {
			this.Zprice = this.$store.getters['ordermeal/ZJ']
		},
		computed: {
			num: {
				get() {
					let num = 0
					this.navList.forEach(item => {
						num += item.num
					})
					return num
				}

			}
		},
		methods: {
			map() {
				uni.chooseLocation({
					success: (res) => {
						console.log(res)
						this.site = res.name
					}
				})
			},
			order() {
				uni.showLoading({
					title: '支付中',
					mask: false
				});
				setTimeout(function() {
					uni.hideLoading()
					uni.showToast({
						title: '支付成功',
					})
				}, 1000)
			}
		},
		onLoad(option) {
			this.navList = JSON.parse(decodeURIComponent(option.data))
			console.log(JSON.parse(decodeURIComponent(option.data)))
		}
	}
</script>

<style>
	page {
		background-color: white;
	}
</style>
<style scoped>
	.top_left {
		padding-left: 10px;
		height: 55px;
		border-bottom: 1px solid #EBEEF5;
		padding-top: 10px;
	}

	.top_left image {
		width: 16px;
		height: 16px;
	}

	.phone {
		font-size: 13px;
		height: 40px;
		display: flex;
		align-items: center;
		border-bottom: 8px solid #EDEDED;
	}

	.tiem {
		height: 70px;
		font-size: 14px;
		border-bottom: 8px solid #EDEDED;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding-left: 10px;
	}

	.cont {
		padding: 0 10px;
	}

	.item {
		height: 80px;
		border-bottom: 1px solid #EBEEF5;
		display: flex;
		padding-top: 20px;
		padding-left: 10px;
		padding-right: 20px;
	}

	.bottom {
		height: 50px;
		background-color: #F2F2F2;
		display: flex;
		align-items: center;
		width: 100%;
		position: fixed;
		bottom: 0;
		justify-content: space-between;
	}
</style>
